#ifndef TEMU_H
#define TEMU_H
typedef unsigned int uint32_t ;
typedef unsigned short uint16_t;
typedef unsigned char uint8_t ;
typedef struct {
    union {
	union {
		uint32_t _32;
		uint16_t _16;
		uint8_t _8;
	} gpr[32];

	/* Do NOT change the order of the GPRs' definitions. */

	uint32_t zero, at, v0, v1, a0, a1, a2, a3;
	uint32_t t0, t1, t2, t3, t4, t5, t6, t7;
	uint32_t s0, s1, s2, s3, s4, s5, s6, s7;
	uint32_t t8, t9, k1, k2, gp, sp, fp, ra;
     };
	uint32_t pc;
	uint32_t hi, lo;

} CPU_state;
enum { STOP, RUNNING, END };

extern CPU_state cpu;
extern const char* regfile[];

extern char assembly[80];
extern char asm_buf[128];
extern int temu_state;
extern char inst_file_path[100];
extern int expr_init;
extern int wp_init;

void init_monitor();
int launch_temu();
char *cmd_ui(char *str);
unsigned int get_pc();
void step();
int cmd_w(char *args);

uint32_t expr(char *expr, bool *success);
#endif // TEMU_H
